﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SensorManager : MonoBehaviour
{
    
    // Start is called before the first frame update
    void Start()
    {
        SensorWrapperInterface.SensorInit();

    }

    // Update is called once per frame
    void Update()
    {
        SensorWrapperInterface.SensorUpdate();

        int x = 0, y = 0, z = 0;
        if (SensorWrapperInterface.SensorTryAccessData(ref x, ref y, ref z) == 0)
        {
            Debug.Log(string.Format("{0}, {1}, {2}", x, y, z));
        } else
        {
            Debug.Log("No new data.");
        }
    }

    private void OnDestroy()
    {
        SensorWrapperInterface.SensorDestroy();
    }
}
